package cn.ztf.zshop.security.api.utlis;

import cn.ztf.zshop.security.api.bo.UserInfoInTokenBO;
import com.alibaba.ttl.TransmittableThreadLocal;

public class UserContext {

    // 可以往子线程中传递线程变量
    private static final ThreadLocal<UserInfoInTokenBO> USER_INFO_IN_TOKEN_HOLDER = new TransmittableThreadLocal<>();

    public static UserInfoInTokenBO get(){
        return USER_INFO_IN_TOKEN_HOLDER.get();
    }

    public static void remove(){
        USER_INFO_IN_TOKEN_HOLDER.remove();
    }


}
